package org.softmed.action.states;

import java.util.HashMap;
import java.util.Map;


public class EventMap {

	protected Map<String,State> map = new HashMap<String,State>();
	
	public void runEvent(String name) throws Throwable{
		State destination = map.get(name);
		destination.execute();
	}
	
	public void addEvent(String name, State destination){
		map.put(name, destination);
	}
	
	public void remove(String name){
		map.remove(name);
	}
	
	public void dispose(){
		map.clear();
	}
	
}
